home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Epic Collection 3
/
Epic Collection 3, The (1997)(Epic Marketing)[!].iso
/
internet
/
tcp
/
easyamitcp20
/
easyamitcp20.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-09-08
|
5KB
|
199 lines
/*
** $VER: EasyAmiTCP v2.0 (31.03.96) 5200
** Copyright (c) 1996 Arne Seime
*/
OPTIONS RESULTS
SIGNAL ON HALT
/* Some declarations */
opt.cd = 0
opt.7wire = 0
opt.noeofmode = 0
opt.useodu = 0
opt.shared = 0
/* Retrieving old information */
/* User names */
OK = open(users,'Amitcp:bin/startnet')
if OK ~=1 then
do
Say "AmiTCP/IP is not properly installed."
Say "File AmiTCP:bin/Startnet not found."
Say "Exiting..."
Exit
end
line = ""
do while left(line,6) ~= 'FailAt'
line = readln(users)
if left(line,9) = '.def USER' then
do
user = substr(line,11)
user = strip(user)
end
/* Netmask & Gateway */
if left(line,9) = '.def MASK' then
do
Xnetmask = substr(line,11)
Xnetmask = strip(Xnetmask)
end
if left(line,7) = '.def GW' then
do
Xgateway = substr(line,9)
Xgateway = strip(Xgateway)
end
if left(line,10) = '.def S2OPT' then
do
Sana2Opts = substr(line,13)
Sana2Opts = left(sana2opts,(length(sana2opts)-1))
end
end
Call Close(users)
OK = open(informa,'Amitcp:db/passwd')
if OK ~=1 then
do
Say "AmiTCP/IP is not properly installed."
Say "File AmiTCP:db/passwd not found."
Say "Exiting..."
Exit
end
do while ~eof(informa)
usx = readln(informa)
luser = length(user)
if left(usx,((luser)+1)) = user'|' then
do
Dig = 0
do y = 1 to 6
Dig = pos('|',usx,(1+Dig))
line.y = Dig
end
XPasswd = substr(usx,((line.1)+1),(line.2-line.1-1))
XUserID = substr(usx,((line.2)+1),(line.3-line.2-1))
XGroupID = substr(usx,((line.3)+1),(line.4-line.3-1))
XRName = substr(usx,((line.4)+1),(line.5-line.4-1))
XHome = substr(usx,((line.5)+1),(line.6-line.5-1))
end
end
Call Close(informa)
/* Name servers & domain */
OK = open(resolv1,'Amitcp:db/resolv.conf')
do while ~eof(resolv1)
line = readln(resolv1)
if left(line,6) = "DOMAIN" then
do
Xdomain = substr(line,8)
Xdomain = strip(Xdomain)
end
if left(line,6) = "NAMESE" then
do
Xnameserver = substr(line,12)
Xnameserver = strip(Xnameserver)
end
end
Call Close(resolv1)
/* Get old Sana2 PPP configuration */
config = sana2opts
Xdevice = word(config,1)
Xunit = word(config,2)
Xbaud = word(config,3)
XIP = word(config,4)
Xoptions = words(config)
do i = 5 to (Xoptions)
opt = word(config,(i))
if opt = "CD" then opt.cd = 1
if opt = "7WIRE" then opt.7wire = 1
if opt = "USEODU" then opt.useodu = 1
if opt = "NOEOFMODE" then opt.noeofmode = 1
if opt = "SHARED" then opt.shared = 1
if left(opt,3) = "MTU" then XMTU = substr(opt,5)
if left(opt,10) = "DIALSCRIPT" then XDial = substr(opt,12)
end
Aboutstring = 'EasyAmiTCP is © Arne Seime 1996'
address EASYAMITCP20
request TITLE '"About EasyAmiTCP"' GADGETS '"OK"' STRING Aboutstring
window ID PAGE TITLE '"EasyAmiTCP v2.0"' COMMAND '"quit"' PORT EASYAMITCP20
group REGISTER '"Names"' '"IP-Adressing"' '"Serial"' '"PPP Options"'
group HORIZ
group
label SINGLE '"Default Name:"'
label SINGLE '"Real Name:"'
label SINGLE '"User ID:"'
label SINGLE '"Group ID:"'
label SINGLE '"Home directory:"'
endgroup
group
string ID DEFNAME user
string ID REALNAME XRname
slider ID USERID MIN 0 MAX 1000 LEVEL XUserID
slider ID GROUPID MIN 0 MAX 1000 LEVEL XGroupID
popasl ID HOME COMMAND '"list ID SLST UPDATE INSERT %s"' PORT DEMO NODE '"popasl"' DIRS CONTENT XHOME
endgroup
endgroup
group HORIZ
group
label SINGLE '"IP Address:"'
label SINGLE '"NetMask:"'
label SINGLE '"Nameserver:"'
label SINGLE '"Gateway:"'
label SINGLE '"Domain Suffix:"'
endgroup
group
string ID IPADRESS XIP
string ID NETMASK XNetmask
string ID NAMESERVER XNameserver
string ID GATEWAY XGateway
string ID DOMAIN XDomain
endgroup
endgroup
group HORIZ
group
label SINGLE '"Serial Driver:"'
label SINGLE '"Unit:"'
label SINGLE '"Baud Rate:"'
label SINGLE '"MTU:"'
label SINGLE '"Dial-Script:"'
endgroup
group
popasl ID SERIAL COMMAND '"list ID XDevice UPDATE INSERT %s"' PORT DEMO NODE '"popasl"' CONTENT XDEvice
slider ID UNIT MIN 0 MAX 10 LEVEL XUnit
cycle ID BAUD COMMAND '"cycle ID CDSP %s"' PORT DEMO NODE '"Baudrate"' '"2400"' '"9600"' '"19200"' '"38400"' '"57600"' '"115200"'
slider ID MTU MIN 1000 MAX 1500 LEVEL XMtu
popasl ID DIALSCRIPT COMMAND '"list ID SLST UPDATE INSERT %s"' PORT DEMO NODE '"popasl"' CONTENT XDIAL
endgroup
endgroup
group HORIZ
group
label SINGLE '"Carrier Detect:"'
label SINGLE '"CTS/RTS:"'
label SINGLE '"No EOF-Mode:"'
label SINGLE '"Use ODU:"'
label SINGLE '"Shared Mode:"'
endgroup
group
check ID CD SELECT opt.cd
check ID CTS SELECT opt.7wire
check ID NOEOF SELECT opt.noeofmode
check ID USEODU SELECT opt.useodu
check ID SHARED SELECT opt.shared
endgroup
endgroup
endgroup
group HORIZ
button COMMAND '"muirexx:easygo"' '"Config"'
button COMMAND 'quit' PORT EASYAMITCP20 '"Exit"'
endgroup
group
gauge ID ACTION LEVEL 0 HELP '"Progress display"' LABEL "%ld percent done..."
endgroup
endwindow
cycle ID BAUD XBaud
call setclip(defname,option.defname)
call setclip(password,xpasswd)
call setclip(s2opts,sana2opts)
exit